#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

typedef struct student
{
	char number[6] ;
	char name[10];
	int score1;
	int score2;
	int score3;
}STU;

void scanf_STU(STU* x)
{
	scanf("%s", &x->number);
	scanf("%s", &x->name);
	scanf("%d", &x->score1);
	scanf("%d", &x->score2);
	scanf("%d", &x->score3);
}

int sum_score(STU* x)
{
	return (x->score1 + x->score2 + x->score3);
}

int main()
{
	int i = 0;
	int n = 0;
	scanf("%d", &n);
	STU max;
	int Max = 0;
	int temp = 0;
	STU stu;
	scanf_STU(&stu);
	Max = sum_score(&stu);
	max = stu;
	for (i = 1;i < n;i++)
	{
		scanf_STU(&stu);
		temp = sum_score(&stu);
		if (temp > Max)
		{
			Max = temp;
			max = stu;
		}
	}
	printf("%s %s %d", max.name, max.number, Max);
	return 0;
}